<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	template="/resources/layout/templateExterno.xhtml"
	xmlns:t="http://myfaces.apache.org/tomahawk"
	xmlns:a4j="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich">
	<ui:define name="body">
		

<f:view>
<!--			<h1>ACESSO AO SISTEMA</h1>
	http://www.grsites.com/generate/generator/?parentresultid=10147642
-->
        
        	<div class="form" style="padding-top:100px; padding-bottom:100px">
        		<h:form id="formLogin">
		        	<h:panelGroup id="pgMensagens">
						  <div>
								<h:messages style="padding:5px" errorClass="errorMessage" infoClass="infoMessage"  />
						</div>
					</h:panelGroup>
		        	
		        	<h:panelGroup id="verificarPrimeiroAcesso">
		        		<h:panelGroup rendered="#{!loginBean.primeiroAcesso}">
					        <fieldset>
					            <legend>Acesso ao Sistema:</legend>
					            
					            <div class="grid-3-12"></div>
					            
					            <div class="grid-6-12">
					                <label class="form-lbl" for="no_login">Usuário:<em class="form-req">*</em></label>
					                <h:inputText id="login" styleClass="form-txt" style="text-transform:lowercase" value="#{loginBean.userName}"
					                	maxlength="30" size="30" required="true" label="Usuário" forceId="true" />
					            </div>
					            
					            <div class="field-clear"></div>
					            
					            <div class="grid-3-12"></div>
					            
					            <div class="grid-6-12">
					                <label class="form-lbl" for="ds_senha">Senha:<em class="form-req">*</em></label>
					                <h:inputSecret id="senha" styleClass="form-txt" value="#{loginBean.password}"
					                	maxlength="10" size="30" required="true" label="Senha" />
					            </div>
					            
					            <div class="field-clear"></div>
					            
					            
					            
					            <div class="grid-5-12"></div>
					            
					            <div class="grid-2-12 form-no-lbl">
						             <h:commandButton styleClass="form-button" reRender="verificarPrimeiroAcesso" value="Acessar" alt="Acessar" title="Acessar" action="#{loginBean.login}"
					    				 />
					    				
							    	
						    	</div>
					        </fieldset>
				        </h:panelGroup>
				        
				       	 <h:panelGroup rendered="#{loginBean.primeiroAcesso}">
					        <fieldset>
					            <legend>Alterar Senha:</legend>
					            
					            <div class="grid-3-12"></div>
					            
					            <div class="grid-6-12">
					                <label class="form-lbl" for="no_login">Nova Senha:<em class="form-req">*</em></label>
					                <h:inputSecret id="senhaAtual" styleClass="form-txt" value="#{loginBean.senhaAtual}"
					                	maxlength="30" size="30" required="true" label="Nova Senha" forceId="true" />
					            </div>
					            
					            <div class="field-clear"></div>
					            
					            <div class="grid-3-12"></div>
					            
					            <div class="grid-6-12">
					                <label class="form-lbl" for="ds_senha">Digite a senha novamente:<em class="form-req">*</em></label>
					                <h:inputSecret id="novaSenha" styleClass="form-txt" value="#{loginBean.password}"
					                	maxlength="10" size="30" required="true" label="Senha" />
					            </div>
					            
					            <div class="field-clear"></div>
					            
					            
					            
					            <div class="grid-5-12"></div>
					            
					            <div class="grid-2-12 form-no-lbl">
						            <h:commandButton styleClass="form-button" value="Alterar Senha" alt="Alterar Senha" title="Acessar" action="#{loginBean.alterarSenha}"
					    				 />
					    				
							    	
						    	</div>
					        </fieldset>
					       </h:panelGroup>
			        
			       </h:panelGroup>
		        </h:form>
		    </div>
		  <t:saveState value="#{loginBean.primeiroAcesso}"></t:saveState>  
    		
		</f:view>
</ui:define>
</ui:composition>

